package com.wei.spring.web.user.filter;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;

/**
 * 类的详细说明
 *
 * @author buhuan.wang
 * @since 2020/12/30
 */
//@Configuration
public class FilterConfiguration {
    @Bean
    public FilterRegistrationBean authFilterRegistrationBean() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(new HttpTraceLogFilter()); //设置自定义的Filter
        registration.addUrlPatterns("/*");  //设置过滤路径
        registration.setName("HttpTraceLogFilter"); //设置过滤器名称
        registration.setOrder(1);   //设置过滤器顺序
        //registration.addInitParameter("paramName", "paramValue");  //设置初始化参数 这里不用
        return registration;

    }
}
